// GameStartDlg.h : header file
//

#if !defined(AFX_GAMESTARTDLG_H__0BC51713_3B38_4C76_AD69_7DBD6E74C41C__INCLUDED_)
#define AFX_GAMESTARTDLG_H__0BC51713_3B38_4C76_AD69_7DBD6E74C41C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CGameStartDlg dialog
#include "EntityDefine.h"
#include "AFXTEMPL.H"
#include "../Include/FileMap.h"
#include "NetProtocl.h"

class CGameStartDlg : public CDialog
{
private :
	BOOL CheckRoleCanUse(lpAccount pAcc);
	CArray<lpAccount,lpAccount> m_arrCheckItems;
	CFileMap m_FileMap;
	BOOL	m_bIsRunning;
	static void		AccUpdateCallBack(lpAccount pAcc,void* pParent);
	static void		SocketCallBack(void* pParent,void* pSocket,int iType=0);
	static void		AccountReviced(NetExchangeType exType,void* pAcc,void* pParent);
	static DWORD WINAPI LoginThread(void* pParam);
	static DWORD WINAPI LoginMonitorThread(void* pParam);
	int	 m_iGameCount;
	int	 m_iCurGameCount;
// Construction
public: 
	void AutoDo();
	void SetServerDisConn();
	BOOL SetMenuItemState(UINT nID, BOOL bIsEnable);
	void SetConnectStateText(BOOL bIsConnected);
	void AutoLogin();
	BOOL AutoLoginMonitor();
	void TestConnection();
	void GetCheckedItems();
	BOOL CheckIsInKey(lpAccount pAcc,CString strKey);
	void AddToUI(lpAccount pAcc,int iType);
	void InitDlgItems();
	lpAccount GetSelectedItem();
	void SetAcc(lpAccount pAcc);
	void LoadConfigInfo();
	void UpdateHOOKDll(CString strGameDir=_T(""));
	CGameStartDlg(CWnd* pParent = NULL);	// standard constructor 
// Dialog Data
	//{{AFX_DATA(CGameStartDlg)
	enum { IDD = IDD_GAMESTART_DIALOG };
	CEdit	m_editConnState;
	CListCtrl	m_listAcc;
	CString	m_strKey;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CGameStartDlg)
	public:
	virtual BOOL DestroyWindow();
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CGameStartDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnBtnFind();
	afx_msg void OnBtnRef();
	afx_msg void OnRclickListAccount(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnDblclkListAccount(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnItemchangedListAccount(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_GAMESTARTDLG_H__0BC51713_3B38_4C76_AD69_7DBD6E74C41C__INCLUDED_)
